|
|
|
|
|
|
|
ByVal dwNotifierType As Long, _
ByVal lpvNotifier As Long, _
lphRasConn As Long) As Long
Public Declare Function RasHangUp Lib "rasapi32.dll" Alias _
"RasHangUpA" (ByVal hRasConn As Long) As Long
Dim hRasConn As Long |
|
|
|
|
|
|
|
|
The RasDial sample program adds a new list box called lstStatus, which is loaded with notifications that are received by the callback function. The callback function calls a public method on the form called UpdateDialStatus, which in turn loads the list box with the notification information as follows: |
|
|
|
|
|
|
|
|
Public Sub UpdateDialStatus(ByVal RasConnState As Long, status As String)
lstStatus.AddItem status
End Sub |
|
|
|
|
|
|
|
|
The dialing process is started using the cmdDial_Click function shown here: |
|
|
|
|
|
|
|
|
Private Sub cmdDial_Click()
Dim dialext As RASDIALEXTENSIONS
Dim rs As RASDIALPARAMS
Dim res As Long
Dim Password As Long
If hRasConn <> 0 Then
MsgBox "Connection already open"
Exit Sub
End If
lstStatus.Clear
dialext.dwSize = Len(dialext)
rs.szEntryName = lstEntries.Text & Chr$(0)
rs.dwSize = Len(rs)
res = RasGetEntryDialParams(vbNullString, rs, Password)
res = RasDial(dialext, vbNullString, rs, 0, AddressOf RasFunc, hRasConn)
End Sub
Private Sub cmdHangup_Click() |
|
|
|
|
|